/**
 * 
 */
package hku.cs.seg.experiment.qsic2010;

import hku.cs.seg.experiment.core.ExecutionTimer;
import hku.cs.seg.experiment.core.LogWriter;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author Jack
 *
 */
public class TestLauncher {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
//		String classpath = ".;C:\\Jack\\workspace\\QSIC2010\\bin;C:\\Jack\\workspace\\QSIC2010\\lib\\abstractparser.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\aduna-clustermap-2006.1.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\aduna-clustermap-2006.1-resources.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\antlr-2.7.6.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\api.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\arq.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\asm.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\asm-attrs.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\aterm-java-1.6.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\axis.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\bsh-2.0b4.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\c3p0-0.9.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-filter-case-normalizer.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-filter-fuzzyants.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-filter-haog.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-filter-lingo.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-filter-stc.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-filter-trc.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-input-lucene.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-input-msnapi.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-input-yahooapi.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-local-core.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-snowball-stemmers.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-stemmer-stempelator.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-util-common.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\carrot2-util-tokenizer.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\cglib-2.1.3.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\Chart2D.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\colt-1.0.3-trimmed.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\commons-codec-1.3.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\commons-collections-3.2.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\commons-discovery-0.2.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\commons-httpclient-3.0.1.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\commons-lang-2.1.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\commons-logging-1.1.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\commons-pool-1.3.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\concurrent.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\db-4.3.29.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\dom4j-1.6.1.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\easymock-1.2_Java1.5.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\format.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\forms-1.0.7.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\gate.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\grok-0.7.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\hessian-3.0.20.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\hibernate3.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\hivemind-1.1.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\hivemind-jmx-1.1.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\hivemind-lib-1.1.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\hsqldb.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\icu4j_3_4.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\impl.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\inference.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\InfoVisual-CB.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\io.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\iri.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\jal.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\Jama-1.0.2.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\jasper-compiler-jdt.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\javassist-3.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\jaxen-1.1-beta-6.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\jaxrpc.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\jdic.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\jdom.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\je.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\jena.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\jetty.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\json.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\jta.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\junit-3.7.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\junit.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\jwnl.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\log4j-1.2.6.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\log4j-1.2.14.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\looks-2.0.4.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-analyzers-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-ant-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-benchmark-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-core-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-highlighter-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-lucli-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-memory-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-misc-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-queries-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-regex-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-similarity-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-snowball-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-spellchecker-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-surround-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-swing-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-wordnet-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\lucene-xml-query-parser-2.1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\maxent.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\mysql-connector-java-3.0.11-stable-bin.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\mysql-connector-java-5.1.9-bin.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\ontobridge.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\opennlp.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\oro-2.0.6.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\owl-servlet.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\pellet.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\rdfapi.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\rdfparser.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\relaxngDatatype.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\RTree.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\rules.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\saaj.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\servlet.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\sil-0.43b-am1.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\SnowBall.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\spamcorpus.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\stax-1.1.2-dev.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\stax-api-1.0.1.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\stempel-1.0-dw.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\stempelator-1.0.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\trove-0.1.8.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\trove.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\validation.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\violinstrings-1.0.2.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\wordnetbridge.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\wsdl4j-1.5.1.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\wstx-asl-2.8.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\xercesImpl.jar;C:\\Jack\\workspace\\QSIC2010\\lib\\xsdlib.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\ant_1.7.1.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\BCEL-4.4.1-sourceforge.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\bcel-5.2.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\bcel-5.2-src.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\BCEL-Gretel.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\bcprov-jdk13-132.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\ccl.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\commons-collections-2.1.1.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\commons-lang-2.3.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\commons-lang-2.3-javadoc.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\commons-lang-2.3-sources.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\commons-lang-2.4.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\cup-runtime.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\Gretel.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\Gretel-runtime.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\jasminclasses-2.3.0.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\java-getopt-1.0.13.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\javancss.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\javax.servlet-5.1.11.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\jcrasher-2.1.3.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\jdbm-1.0.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\jdbm-1.0.zip;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\junit-3.8.1.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\junit-4.6-src.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\junit-4.7.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\junit_3.4.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\junit_3.4_src.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\junit_3.8.1_src.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\log4j-1.2.7.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\lpsolve55j.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\mujava.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\mujava_src.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\openjava2005.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\openjava_src.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\polyglotclasses-1.3.5.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\sootclasses-2.3.0.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\sootclasses-2.3.0-src.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\sootclasses_latest.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\svnkit_1.3.0.jar;C:\\Documents and Settings\\Administrator\\My Documents\\Research\\Experiment\\lib_common\\velocity-1.4.jar;C:\\Jack\\lib\\jcolibri2.jar";
//		System.setProperty("java.class.path", classpath);
//		System.out.println(System.getProperty("java.class.path"));
//		return;
		String versionName = args[0];
		TestSuiteManager.TimeoutTolerance = Integer.parseInt(args[1]);
		String testsuiteFilename = args[2];
		//String logname = "C:\\Jack\\workspace\\QSIC2010\\logs\\" + new SimpleDateFormat("[yyyy-MM-dd] HH-mm-ss").format(new Date(System.currentTimeMillis())) + ".log";
		String logname = args[3];
		LogWriter.me().init(logname);

		ExecutionTimer totalTime = new ExecutionTimer();
		totalTime.startCounter("Total");	
		TestSuiteManager.VersionName = versionName;
		TestSuiteManager.loadAndRun(testsuiteFilename);
		
//		System.out.println("Total runing time:" + totalTime.endCounter("Total") / 1000.0);
	}
}
